package com.ourteam.product.model.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 IRKT 2017
 * Auto Generate Date : 2017-11-15 14:53:58
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductModelBaseRelateBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.model.dao.IProductModelBaseRelateDAO.Id);

        mappedDaoFields.put("modelBaseId",
            com.ourteam.product.model.dao.IProductModelBaseRelateDAO.ModelBaseId);

        mappedDaoFields.put("modelDomainId",
            com.ourteam.product.model.dao.IProductModelBaseRelateDAO.ModelDomainId);

        mappedDaoFields.put("status",
            com.ourteam.product.model.dao.IProductModelBaseRelateDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.product.model.dao.IProductModelBaseRelateDAO.Remarks);
    }

    private com.ourteam.product.model.dao.ProductModelBaseRelate productModelBaseRelate;

    public ProductModelBaseRelateBean() {
        super();

        this.productModelBaseRelate = new com.ourteam.product.model.dao.ProductModelBaseRelate();
    }

    public ProductModelBaseRelateBean(
        com.ourteam.product.model.dao.ProductModelBaseRelate productModelBaseRelate) {
        super();

        this.productModelBaseRelate = productModelBaseRelate;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(productModelBaseRelate);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.model.dao.ProductModelBaseRelate convertToProductModelBaseRelate() {
        return this.productModelBaseRelate;
    }

    public com.ourteam.product.model.dao.ProductModelBaseRelate convertTo() {
        return this.productModelBaseRelate;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productModelBaseRelate.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productModelBaseRelate.setId(id);
    }

    /**
     * Get modelBaseId
     *
     * @return long
     */
    public long getModelBaseId() {
        return (long) this.productModelBaseRelate.getModelBaseId();
    }

    /**
     * Set modelBaseId
     *
     * @parameter long
     */
    public void setModelBaseId(long modelBaseId) {
        this.productModelBaseRelate.setModelBaseId(modelBaseId);
    }

    /**
     * Get modelDomainId
     *
     * @return long
     */
    public long getModelDomainId() {
        return (long) this.productModelBaseRelate.getModelDomainId();
    }

    /**
     * Set modelDomainId
     *
     * @parameter long
     */
    public void setModelDomainId(long modelDomainId) {
        this.productModelBaseRelate.setModelDomainId(modelDomainId);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.productModelBaseRelate.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.productModelBaseRelate.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.productModelBaseRelate.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.productModelBaseRelate.setRemarks(remarks);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductModelBaseRelateBean) == false) {
            return false;
        } // end if

        ProductModelBaseRelateBean other = (ProductModelBaseRelateBean) obj;

        boolean isEqual = false;

        com.ourteam.product.model.dao.ProductModelBaseRelate tempProductModelBaseRelate =
            other.convertToProductModelBaseRelate();

        if ((tempProductModelBaseRelate == null) ||
                (this.productModelBaseRelate == null)) {
            isEqual = false;
        } else if ((tempProductModelBaseRelate == this.productModelBaseRelate) ||
                tempProductModelBaseRelate.equals(this.productModelBaseRelate)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductModelBaseRelateBean[] toArray(
        com.ourteam.product.model.dao.ProductModelBaseRelate[] aProductModelBaseRelates) {
        return toArray(aProductModelBaseRelates, null);
    }

    public static ProductModelBaseRelateBean[] toArray(
        com.ourteam.product.model.dao.ProductModelBaseRelate[] aProductModelBaseRelates,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductModelBaseRelates)) {
            return new ProductModelBaseRelateBean[0];
        }

        int length = aProductModelBaseRelates.length;

        ProductModelBaseRelateBean[] beans = new ProductModelBaseRelateBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductModelBaseRelateBean(aProductModelBaseRelates[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductModelBaseRelates[i] });
            }
        }

        return beans;
    }
}
